package com.haha.im

import android.app.ProgressDialog
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

abstract class BaseActivity:AppCompatActivity() {
    val progressDialog by lazy { ProgressDialog(this) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getLayoutResId())
        init()
    }

    open fun init() {

    }

    abstract fun getLayoutResId():Int

    fun showProgress(msg:String){
        progressDialog.setMessage(msg)
        progressDialog.show()
    }

    fun hideProgress(){
        progressDialog.dismiss()
    }
}